package vcp.gui.forms.validators;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Validate password input
 *
 */
public class PasswordValidator {
	private Pattern pattern;
	private Matcher matcher;
	private static final String PATTERN = "((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})";
	public  PasswordValidator(){
		pattern = Pattern.compile(PATTERN);
	}	
	public boolean validate(String txt){		 
		  matcher = pattern.matcher(txt);
		  return matcher.matches();
	}	
}
